package edu.citadel.db;

import edu.citadel.domain.Contact;

/**
 * User: jordan
 * Date: 3/10/13
 * Time: 1:55 PM
 */
public abstract class ContactDao extends AbstractDao {

    public void saveContact(Contact contact) {
        Integer id = (Integer) getSqlTemplate().insert("contact.save", contact);
        getLogger().info("GOT ID back: " + id);

        if (contact.getContactId() == 0 && id != null && id > 0) {
            getLogger().info("SETTING NEW ID!");
            contact.setContactId(id);
        }
    }
}
